Skip to content

feat(spec,mcp-server): add @colony/spec and six spec_* MCP tools#42

Merged
NagyVikt merged 1 commit intomainfrom
agent/claude/add-colony-spec-package-2026-04-24-11-35
Apr 24, 2026
Merged

feat(spec,mcp-server): add @colony/spec and six spec_* MCP tools#42
NagyVikt merged 1 commit intomainfrom
agent/claude/add-colony-spec-package-2026-04-24-11-35

Conversation

@NagyVikt
Copy link
Copy Markdown
Collaborator

Automated by gx branch finish (PR flow).

colonykit-in-colony: a spec-driven dev lane that rides on @colony/core's
TaskThread, ProposalSystem, and MemoryStore instead of introducing
parallel infrastructure.

**packages/spec/** (new workspace package):
  - grammar.ts     — SPEC.md parser / serializer, §G §C §I §V §T §B
                     sections, always-on invariants (`.always` id suffix),
                     FNV-1a stable hash
  - change.ts      — CHANGE.md with §P §S §T §B plus base_root_hash
                     front-matter for three-way merge
  - sync.ts        — three-way merge with three strategies: three_way
                     (default), refuse_on_conflict, last_writer_wins
  - backprop.ts    — failure-signature gate (test-id + error-class +
                     top-3 frames). Promotes a §V draft via
                     ProposalSystem only after promote_after matches
                     (default 2) — no flake-driven invariant churn
  - context.ts     — cite-scoped context loader; resolves a §T id to
                     its transitive closure of cites plus §V.always
  - repository.ts  — filesystem ↔ MemoryStore bridge, atomic archive
                     via tempdir-then-rename so a crash mid-move leaves
                     either the archived or the pre-archive state
  - hash.ts        — base_root_hash computation + verification
  - constants.ts   — SPEC_OBSERVATION_KINDS, SPEC_BRANCH_PREFIX

**apps/mcp-server/src/tools/spec.ts** (new):
  Six MCP tools — spec_read, spec_change_open, spec_change_add_delta,
  spec_build_context, spec_build_record_failure, spec_archive — wired
  in via the same `register(server, ctx)` pattern as the other tool
  groups. Uses MemoryStore.addObservation directly for spec-kind
  observations so we don't need to widen TaskThread.post's kind enum.

**skills/**: /co:change, /co:build, /co:check, /co:archive definitions
for Claude Code users who want to drive the spec flow via slash
commands. Not loaded by any runtime — consumed by hand when a user
opts in.

Tests: packages/spec covers grammar round-trip, always-on detection,
stable hashing, cite-scope transitive closure, all four sync conflict
shapes (10/10 green). apps/mcp-server listTools assertion extended
with the six new tools (17/17 green).

This change intentionally does NOT add: colonykit init CLI, token-
budget CI gate, design.md scaffolding, or cross-change concurrent-edit
detection. Prove the core loop on one change before adding surface.
@NagyVikt NagyVikt merged commit d6bfe31 into main Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant